package com.yang.action;

import com.yang.entity.User;
import com.yang.service.UserService;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.yang.util.RespEntity;
import com.yang.util.RespUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

@WebServlet("/UserQueryById")
public class UserQueryByIdAction extends HttpServlet {
    UserService userService = new UserService();
    //登录
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        System.out.println("jjjjjjj");
        String login = req.getParameter("login");
        System.out.println(login);
        String pwd = req.getParameter("pwd");
        System.out.println(pwd);
        RespEntity respEntity = userService.queryUserBylogin(login,pwd);
        RespUtil.sendJSON(resp,respEntity);
    }
}

